import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false

App.mpType = 'app'
import zcHttp from "./common/zcHttp.js"
Vue.prototype.$ZcPublic={
	AppId:'wxf9d7ede3ad741d3a',	//正式wx8b648210af5f11b0	// wxf9d7ede3ad741d3a
	Server: zcHttp,
	IsErrLog:'false', 
		// Domain:'https://partnertest.ezcsoft.com/', //测试版 http://testzhgw.jdrongxin.com/
	Domain:'http://127.0.0.1:8011/', //正式版  https://zhgw.jingdianqiche.cn
	KeyHttp:'zcsoft_uni_partner_httpurl',
	KeySession:'zcsoft_uni_partner_session',
	WaitModel: '0',
	CarKey: '',
	CarUrl: '',
	IsPerLog: 'false',
	formatDate:function(date, fmt) { //json日期转换
	let currentDate;
			if(date){
				if(date.indexOf("Date")>=0){
				let tmp = /\d+(?=\+)/.exec(date);
				let d = new Date(+tmp);
				 currentDate = new Date(d);
				}else{
					 date =date.split(" ")[0];
					 return date;
				}
			}else{
				
				 return "";
			}
			  let o = {
			    "M+": currentDate.getMonth() + 1, //月份
			    "d+": currentDate.getDate(), //日
			    "h+": currentDate.getHours(), //小时
			    "m+": currentDate.getMinutes(), //分
			    "s+": currentDate.getSeconds(), //秒
			    "q+": Math.floor((currentDate.getMonth() + 3) / 3), //季度
			    "S": currentDate.getMilliseconds() //毫秒
			  };
			  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (currentDate.getFullYear() + "").substr(4 - RegExp.$1.length));
			  for (let k in o)
			    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
			  return fmt;
			},
	Err:function(msg) {
		uni.showModal({
		    title: '错误',
		    content: msg,
			showCancel: false
		});
	},
	Loading:function(msg) {
		uni.showLoading({
			title:msg,
			mask:true
		});
	},
	Msg:function(msg){
		uni.showModal({
			title: '温馨提示',
			content: msg,
			showCancel: false
		});
		//throw Error('');
	}
}


const app = new Vue({
    ...App
})
app.$mount()
